package com.netsdk.yushi.controller;

import cn.hutool.core.date.DateUtil;
import com.netsdk.yushi.dto.YushiRequest;
import com.netsdk.yushi.dto.YushiResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author aqie
 * @Date 2022/3/26 17:00
 * @desc
 */
@Slf4j
@RestController
@RequestMapping
public class YushiController {

    @RequestMapping
    public YushiResponse index(YushiRequest request){
        log.info("{}", request);
        Integer seq = request.getSeq();
        YushiResponse response = new YushiResponse();
        YushiResponse.ResponseDTO.DataDTO data = new YushiResponse.ResponseDTO.DataDTO();
        data.setTime(DateUtil.now());
        data.setRecordID(seq);
        YushiResponse.ResponseDTO responseDTO = new YushiResponse.ResponseDTO();
        responseDTO.setData(data);
        responseDTO.setStatusString("Succeed");
        responseDTO.setStatusCode(0);
        response.setResponse(responseDTO);
        return response;
    }

}
